package main

import "fmt"

// 切片作为函数参数
func main() {
	array := [5]int{1, 2, 3, 4, 5}
	slice := []int{1, 2, 3, 4, 5}

	modifyArray(array)
	fmt.Println(array)

	modifySlice(slice)
	fmt.Println(slice)

	modifyArrayPoint(&array)
	fmt.Println(array)
}

func modifyArray(array [5]int) {
	array[0] = 666
}
func modifyArrayPoint(array *[5]int) {
	array[0] = 666
}
func modifySlice(slice []int) {
	slice[0] = 666
}
